/**
 *  @file projectile.h
 *
 *  @date 16-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef PROJECTILE_H_
#define PROJECTILE_H_

#include "sprite.h"

namespace si
{

/**
 * Direction the bullet is going to move.
 */
enum Direction { DIR_UP, DIR_DOWN };

/**
 * Anything shot from a Ship is a projectile. Projectile's can do
 * damage to the oponent's ship (be it the player or the AI).
 */
class Projectile: public si::Sprite
{
public:
	friend class CollisionDetector;
	/**
	 * Constructs a projectile
	 * @param damage Amount of damage the projectile will do on hit
	 * @param dir Direction (up or down) the projectile wil be moving in
	 * @param virtualSize How big the projectile is
	 * @return
	 */
	Projectile(int damage, Direction dir, Vector2 virtualSize);
	virtual ~Projectile();

	bool deleteMe() const
	{
		return !((fController->getPosition().getY() < 3.02) && (fController->getPosition().getY() > -3.02)
					&& (fController->getPosition().getX() < 4.02) && (fController->getPosition().getX() > -4.02));
	}

	virtual void update(double time);

protected:
	int fDamage; // damage this proj will do on hit...
	Direction fDirection;
};

}

#endif /* PROJECTILE_H_ */
